<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String lib = request.getContextPath();
%>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
	content="A layout example with a side menu that hides on mobile, just like the Pure website.">
<title>摇摇乐 后台管理</title>
<link rel="stylesheet"
	href="http://yui.yahooapis.com/pure/0.4.2/pure.css">
<!--[if lte IE 8]>
        <link rel="stylesheet" href="${lib}css/layouts/side-menu-old-ie.css">
    <![endif]-->
<!--[if gt IE 8]><!-->
<link rel="stylesheet" href="../css/layouts/side-menu.css">
<!--<![endif]-->
</head>
<body>
	<div id="layout">
		<!-- Menu toggle -->
		<a href="#menu" id="menuLink" class="menu-link"> <!-- Hamburger icon -->
			<span></span>
		</a>
		<div id="menu">
			<div class="pure-menu pure-menu-open">
				<a class="pure-menu-heading" href="#">管理菜单</a>
				<ul>
					<li><a href="index.jsp">主页</a></li>
					<li class="menu-item-divided pure-menu-selected"><a
						href="poemadd.jsp">彩票填写</a></li>
					<li><a href="#">摇摇乐后台服务</a></li>
				</ul>
			</div>
		</div>
		<div id="main">
			<div class="header">
				<h1>填写彩票相关信息</h1>
			</div>
			<div id="main">
				<div class="content">
					<h2 class="content-subhead">彩票app诗填写</h2>
					<form id="form-add" class="pure-form" action="/view/add.ac"
						method="post">
						<fieldset class="pure-group">
							<input type="text" name="pome_1" class="pure-input-1-2"
								placeholder="填写诗第一句"> <input type="text" name="pome_2"
								class="pure-input-1-2" placeholder="填写诗第二句"> <input
								type="text" name="pome_3" class="pure-input-1-2"
								placeholder="填写诗第三句"> <input type="text" name="pome_4"
								class="pure-input-1-2" placeholder="填写诗第四句">
						</fieldset>
						<button type="button"
							class="pure-button pure-input-1-2 pure-button-primary" id="add">保存</button>
					</form>
				</div>
			</div>
			<div id="main">
				<div class="content">
					<h2 class="content-subhead">彩票试机号填写</h2>
					<form id="form-add_sssue" class="pure-form"
						action="/view/add_sssue.ac" method="post">
						<fieldset class="pure-group">
							期数:<input type="text" name="about" class="pure-input-1-2"
								placeholder="填写本期期数"> 试机号:<input type="text" name="text"
								class="pure-input-1-2" placeholder="填写本期试机号">
						</fieldset>
						<button type="button"
							class="pure-button pure-input-1-2 pure-button-primary"
							id="add_sssue">保存</button>
					</form>
				</div>
			</div>
			<!-- <form id="form-add_sssue" class="pure-form"
						action="/view/query_services_max_sssue.ac" method="post">
						
						<button type="submit"
							class="pure-button pure-input-1-2 pure-button-primary"
							id="dfdsf">保存ss</button>
					</form> -->
		</div>
		<script src="../js/ui.js"></script>
		<script src="../js/jquery-2.1.0.min.js"></script>
		<script type="text/javascript">
			$(document)
					.ready(
							function() {
								$("button#add")
										.click(
												function() {
													var params = $(
															"form#form-add")
															.serialize();
													params = decodeURIComponent(
															params, true);
													$
															.ajax({
																cache : true,
																type : "POST",
																url : "add.ac",
																data : params,
																async : false,
																error : function(
																		request) {
																	alert("添加失败");
																},
																success : function(
																		data) {
																	alert("添加成功");
																	$(':input',
																			'form#form-add')
																			.not(
																					':button, :submit, :reset, :hidden')
																			.val(
																					'')
																			.removeAttr(
																					'checked')
																			.removeAttr(
																					'selected');
																}
															});
												});
								$("button#add_sssue")
										.click(
												function() {
													var params = $(
															"form#form-add_sssue")
															.serialize();
													params = decodeURIComponent(
															params, true);
													$
															.ajax({
																cache : true,
																type : "POST",
																url : "add_sssue.ac",
																data : params,
																async : false,
																error : function(
																		request) {
																	alert("添加失败");
																},
																success : function(
																		data) {
																	alert("添加成功");
																	$(':input',
																			'form#form-add_sssue')
																			.not(
																					':button, :submit, :reset, :hidden')
																			.val(
																					'')
																			.removeAttr(
																					'checked')
																			.removeAttr(
																					'selected');
																}
															});
												});
							});
		</script>
</body>
</html>
